package com.dg.contorller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.dg.redis.RedisUtils;


@RestController
@RequestMapping("/redis")
public class RedisController {

	@Autowired
	private RedisUtils redis;
	
	@RequestMapping("/save")
	public void save(String key,String value) {
		
		redis.set(key, value);
		
	}
	
	@RequestMapping("/getValue")
	public String getValue(String key) {
		return redis.get(key).toString();
		
	}
	
}
